home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambradio.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  80 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbRadio.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        entered
  13.     message     timer
  14.  
  15.     thing        soundPos0
  16.     
  17.     sector      on_sec1         linkID=1
  18.     sector      on_sec2         linkID=1
  19.     
  20.     sector      off_sec1        linkID=0
  21.     sector      off_sec2        linkID=0
  22.  
  23.     sound        noise0=riv_radio_chatter_a1.wav   local
  24.     sound        noise1=riv_radio_chatter_a2.wav   local
  25.     sound        noise2=riv_radio_chatter_a3.wav   local
  26.     sound        noise3=riv_radio_chatter_a4.wav   local
  27.     sound        noise4=riv_radio_chatter_a5.wav   local
  28.     
  29.     int         chatterOff=0    local
  30.     int         newLine         local
  31.     int         oldLine         local
  32.     int         noiseChannel    local
  33.     
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. entered:
  41.  
  42.     if(GetSenderID() == 1)
  43.     {
  44.         chatterOff = 0;
  45.         SetTimer(1.0);
  46.     }
  47.     
  48.     if(GetSenderID() == 0)
  49.     {
  50.         chatterOff = 1;
  51.     }
  52.     
  53.     return;
  54.  
  55. # ========================================================================================
  56.  
  57. timer:
  58.  
  59.     while (newLine == oldLine)
  60.     {    
  61.         newLine = RandBetween(0, 4); # pick new line
  62.     }
  63.     
  64.     oldLine = newLine; # remember what got picked
  65.     
  66.     noiseChannel = PlaySoundThing(noise0[newLine], soundPos0, 1.0, 2, 8, 0);    # was 1, 6
  67.     WaitForSound(noiseChannel);
  68.     
  69.     if(chatterOff == 0)
  70.     {
  71.         Sleep(Rand());
  72.         SetTimer(1.0);
  73.     }
  74.  
  75.     return;
  76.  
  77. # ========================================================================================
  78.  
  79. end
  80.